// src/api/customer.ts
import { request } from './request'

export interface CustomerT {
  customerId: number
  customerName: string
  phoneNumber: string
  address: string
  memberBalance: number
  points: number
  platformBalance:number
}

export interface CustomerListRsp {
  code: number
  msg: string
  data: CustomerT[]
  stamp: number
  success: boolean
}

/* 获取客户列表（全量，GET） */
export function getCustomerL() {
  return request<CustomerListRsp>({
    url: '/system/customer/list',
    method: 'GET'
  })
}
// 充值
export interface RechargeReq {
  customerId: number
  amount: number
}

export interface RechargeRsp {
  code: number
  msg?: string
  data?: CustomerT
  success: boolean
}

export function chongZhi(data: RechargeReq) {
  return request<RechargeRsp>({
    url: '/system/customer/balance/add',
    method: 'POST',
    data
  })
}
